Telegram Group & Telegram Channel
🐍 Задача про умножение матриц

Условие: Вам даны две матрицы, нужно написать функцию для их умножения. Матрицы могут быть квадратными или прямоугольными.

Решение: Напишем решение на чистом Python
def matrix_multiply(A, B):
# Сначала проверим, можем ли мы вообще перемножить эти матрицы
if len(A[0]) != len(B):
raise ValueError("Number of A columns must equal number of B rows.")

# Инициализируем результирующую матрицу, заполненную нулями
result = [[0 for _ in range(len(B[0]))] for _ in range(len(A))]

# Перемножим матрицы
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]

return result

# Проверим функцию на примере
A = [[1, 2, 3],
[4, 5, 6]]

B = [[7, 8],
[9, 10],
[11, 12]]

result = matrix_multiply(A, B)
for row in result:
print(row)


#программирование
#линейная_алгебра



tg-me.com/ds_interview_lib/268
Create:
Last Update:

🐍 Задача про умножение матриц

Условие: Вам даны две матрицы, нужно написать функцию для их умножения. Матрицы могут быть квадратными или прямоугольными.

Решение: Напишем решение на чистом Python

def matrix_multiply(A, B):
# Сначала проверим, можем ли мы вообще перемножить эти матрицы
if len(A[0]) != len(B):
raise ValueError("Number of A columns must equal number of B rows.")

# Инициализируем результирующую матрицу, заполненную нулями
result = [[0 for _ in range(len(B[0]))] for _ in range(len(A))]

# Перемножим матрицы
for i in range(len(A)):
for j in range(len(B[0])):
for k in range(len(B)):
result[i][j] += A[i][k] * B[k][j]

return result

# Проверим функцию на примере
A = [[1, 2, 3],
[4, 5, 6]]

B = [[7, 8],
[9, 10],
[11, 12]]

result = matrix_multiply(A, B)
for row in result:
print(row)


#программирование
#линейная_алгебра

BY Библиотека собеса по Data Science | вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/ds_interview_lib/268

View MORE
Open in Telegram


Библиотека собеса по Data Science | вопросы с собеседований Telegram | DID YOU KNOW?

Date: |

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

Библиотека собеса по Data Science | вопросы с собеседований from fr


Telegram Библиотека собеса по Data Science | вопросы с собеседований
FROM USA